package com.site.wisdom_construction.controller.statisticsModule;

import com.site.wisdom_construction.responseEntity.OneDataResult;
import com.site.wisdom_construction.service.statisticsModule.StatisticsDelayRecordService;
import com.site.wisdom_construction.util.verification.NoToken;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @Author daiyifei
 * @Date 2022/3/9
 * @Description
 */
@Api(tags = "滞后原因统计数据接口")
@RestController
@RequestMapping("StatisticsDelayRecord")
@CrossOrigin
public class StatisticsDelayRecordController {
    @Autowired
    private StatisticsDelayRecordService statisticsDelayRecordService;

    @ApiOperation(value = "根据滞后类型统计数据", notes = "测试数据:")
    @PostMapping("/countDelayRecordByDelayName")
    @NoToken
    public OneDataResult countDelayRecordByDelayName(@RequestBody Map map) {
        OneDataResult oneDataResult = new OneDataResult();
        oneDataResult.setData(statisticsDelayRecordService.countDelayRecordByDelayName(map));
        return oneDataResult;
    }
}
